home *** CD-ROM | disk | FTP | other *** search
/ Robotics & Artificial Int…3 (Professional Edition) / Robotics & Artificial Intelligence Tools 2003 (Professional Edition).iso / neural network tool and application / nsinstall.exe / data1.cab / DllSys_Files / PREPOST / PREPOST.C
Encoding:
C/C++ Source or Header  |  2002-03-08  |  1.4 KB  |  40 lines

  1. // Dynamic link library implementation of a generic pre/post-processor
  2.  
  3. #include "NSDLL.h"
  4.  
  5. /***************************/
  6. /* Activation of component */
  7. __declspec(dllexport) BOOL performPrePost(
  8.     DLLData    *instance,    // Pointer to instance data (may be NULL)
  9.     NSFloat    *input,     // Pointer to the input data
  10.     NSFloat    *output,     // Pointer to the output data
  11.     int rows,             // Number of rows of data
  12.     int cols,             // Number of cols of data
  13.     BOOL preprocessor    // Flag to indicate whether this is a preprocessor or postprocessor
  14.     )
  15. {
  16.     int i, length=rows*cols;
  17.     for (i=0; i<length; i++)
  18.         output[i] += input[i];
  19.     return TRUE;    // Return whether to inject this sample or to call performPrePost with another sample
  20. }
  21.  
  22. /******************************************/
  23. /* Management of instance data (OPTIONAL) */
  24. /*
  25. __declspec(dllexport) DLLData *allocPrePost(
  26.     DLLData    *oldInstance,    // Pointer to the last instance if reallocating
  27.     int *rows,         // Number of rows of output data, can be changed to reflect a diffenent number for the input data
  28.     int *cols,         // Number of cols of output data, can be changed to reflect a diffenent number for the input data
  29.     BOOL preprocessor    // Flag to indicate whether this is a preprocessor or postprocessor
  30.     )
  31. {
  32.     DLLData *instance = allocDLLInstance(oldInstance);
  33.     return instance;
  34. }
  35.  
  36. __declspec(dllexport) void freePrePost(DLLData *instance)
  37. {
  38.     freeDLLInstance(instance);
  39. }
  40. */